package com.mq.retry;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消费消息
 * @author ytj
 * @date 2024/1/16
 */
@Component
@RabbitListener(queues = Demo7Message.QUEUE)
public class Demo7Consumer {

    @RabbitHandler
    public void message(Demo7Message message){
        System.out.println("接收到消息为:"+message.getId());
        throw new RuntimeException("测试消息处理失败");
    }

}
